package com.liuyz.demo1;


public class Test {

    public static void main(String[] args) {
        Son son = new Son();
        System.out.println(son.name);
//        System.out.println(son.age);
    }

}

class GrandPa {
    String name = "爷爷";
    String bobby = "旅游";
    int age = 60;
}

class Father extends GrandPa {
    String name = "爸爸";
    private int age = 40;
}

class Son extends Father {
    String name = "儿子";
}